﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace map.Controls
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxFunction));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(TestAjaxClass));
            
        }
    }
}

public class TestAjaxClass
{
    [AjaxPro.AjaxMethod ]
    public Student GetStudent()
    {
        Student stu = new Student();//{Id:"1",Name:"dingyuliang" };
        stu.Id = "1";
        stu.Name = "ding";    
        return stu ;
    }

    [AjaxPro.AjaxMethod ]
    public Student SetStudent(Student stu)
    {
        stu.Name = "Server Changed";
        return stu;
    }
}


public class Student
{
    public string Id
    { get; set; }

    public string Name
    { get; set; }

    [AjaxPro.AjaxMethod ]
    public void SetId(string _id)
    {
        this.Id = _id;
    }
}


